package dev.ece.util.tools;

public class Timer {
	
	private int fps;
	
	private int testFps;
	
	private long currentTime;
	
	private long testDelay;
	
	private long delay;
	
	private float dalyTime;
	
	public void begin() {
		currentTime = System.currentTimeMillis();
	}
	
	public void testFinish() {
		testDelay = System.currentTimeMillis() - currentTime;
	}
	
	public void finish() {
		delay = System.currentTimeMillis() - currentTime;
		fps = delay > 0 ? (int) (1000 / delay) : 1000;
		testFps = testDelay > 0 ? (int) (1000 / testDelay) : 1000;
		dalyTime = delay / 1000f;
	}

	public int getFps() {
		return fps;
	}

	public int getTestFps() {
		return testFps;
	}

	public long getTestDelay() {
		return testDelay;
	}

	public long getDelay() {
		return delay;
	}

	public float getDalyTime() {
		return dalyTime;
	}
}
